{/* LAYOUT模板 */}
	<layout name="layout"/>
{/* LAYOUT模板 */}

<!-- [position] -->
	<include file="Template:position"/>
<!-- [position] -->

<div>
	<form name="catform" action="__APP__/Course/updatesupplierOk" method="post" enctype="multipart/form-data">
		<div>				
			<table id="mytab"  border="1" class="t1" width="100%">
				<!--名称-->
				<tr style="height:50px;">
					<th align="right" width="20%">
						提供商名字
					</th>
					<td>
						<span>
							<input type="text" class="input" name="name" value="{$supplier.name}"/>					
						</span>
						<span class="redtext">{$lang.input_tips}</span>
					</td>
				</tr>
				<!--简介-->
				<tr style="height:50px;">
					<th align="right">
						简介
					</th>
					<td>
						<span>
							<textarea name="description" style="width:420px; height:200px;"/>{$supplier.description}</textarea>		
						</span>
						<span class="redtext">{$lang.input_tips}</span>
					</td>
				</tr>
				<!--提供商图片-->
				<tr style="height:50px;">
					<th align="right">
						提供商图片
					</th>
					<td>
						<span>
							<img id="original_img" title="{$supplier.original_img}" style="width:200px;height:200px;" src="__PUBLIC__/Upload/images/{$supplier.original_img}"/>
						</span>
						<br/>
						<br/>
						<br/>
						<span>
							<input type="file"  name="original_img" value=""/>					
						</span>
						<span class="redtext">{$lang.input_tips}</span>
					</td>
				</tr>
				<!--是否显示-->
				<tr style="height:50px;">
					<th align="right">
						是否显示
					</th>
					<td>
						<div>
							<span>
								<input type="radio"  name="invalid" value="0"/>{$Think.lang.yes}
							</span>
							<span>
								<input type="radio" name="invalid" value="1"/>{$Think.lang.no}
							</span>
						</div>
					</td>
				</tr>				
			</table>			
		</div>
		<div class="submit" style="text-align:center;">
		<input type="hidden" name="id" value="{$supplier.id}"/>
		<input type="submit" value="{$Think.lang.submit}"/>
		<input type="button" name="reset" value="{$Think.lang.reset}"/>	
	</form>		
</div>

<script>
	//初始化照片是否显示
	function initImg(id){
		if(typeof id ==  'undefined') return;		
		var imgObj   =   document.getElementById(id);
		if(imgObj.getAttribute('title').length == 0){
			imgObj.style.display = 'none';
		}
		else{
			imgObj.style.display = 'block';
		}
	}	
	initImg('original_img');
	
	//初始化input-radio
	function initInput(name,value){
		
		if(typeof name == 'undefined') return;
		if(typeof value == 'undefined') return ;
		var inputObj     =   document.getElementsByName(name);
		
		for(var i = 0; i < inputObj.length; i ++){
			if(inputObj[i].value == value){
				inputObj[i].checked  = true;
				break;
			}
		}		
	}
	initInput('invalid',{$supplier.invalid});
</script>
